import { Controller, Post, HttpStatus, HttpCode, Body, Param, Delete, Patch, Get, Query, ParseIntPipe } from '@nestjs/common';
import { ApiTags, ApiBearerAuth, ApiOperation, ApiCreatedResponse, ApiOkResponse } from '@nestjs/swagger';
import adminConfig from '@src/config/admin.config';
import { LoggerRep } from './dto';
import { LoggerService } from '@src/service/admin/logger/logger.service';

@ApiTags('api-log')
@ApiBearerAuth()
@Controller(`${adminConfig.adminPath}/log`)
export class LoggerController {
  constructor(
    private readonly loggerService: LoggerService
  ) { }


  /**
  * @Description: 获取日志列表
  * @param {type}
  * @return:
  */
  @ApiOperation({ summary: '获取字典列表', description: '获取字典列表' })
  @ApiOkResponse({ type: [LoggerRep] })
  @Get('list')
  @HttpCode(HttpStatus.OK)
  public async dictList(@Query() queryOption: { [propsName: string]: any }): Promise<LoggerRep[]> {
    return await this.loggerService.findPage(queryOption);
  }
}